# Find all directories containing a Makefile
SUB_DIRS := $(shell find . -type f -name Makefile | xargs dirname | grep -v "^.$$")

.PHONY: all clean

all:
	@for dir in $(SUB_DIRS); do \
  		echo "Building $$dir"; \
  		$(MAKE) -C $$dir; \
  	done

clean:
	@for dir in $(SUB_DIRS); do \
  		echo "Cleaning $$dir"; \
  		$(MAKE) -C $$dir clean; \
  	done